package com.alexgaoyh.MutiModule.Dubbo.RWSeperate.persist.manager.sysman.sysmanResource;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.MutiModule.common.vo.TreeNode;
import com.MutiModule.common.vo.ZTreeNodes;

public interface SysmanResourceMapper {
    int countByExample(SysmanResourceExample example);

    int deleteByExample(SysmanResourceExample example);

    int deleteByPrimaryKey(Long id);

    int insert(SysmanResource record);

    int insertSelective(SysmanResource record);

    List<SysmanResource> selectByExample(SysmanResourceExample example);

    SysmanResource selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") SysmanResource record, @Param("example") SysmanResourceExample example);

    int updateByExample(@Param("record") SysmanResource record, @Param("example") SysmanResourceExample example);

    int updateByPrimaryKeySelective(SysmanResource record);

    int updateByPrimaryKey(SysmanResource record);
    
	//alexgaoyh add begin
    List<TreeNode> selectTreeNodeBySysmanResourceId(Long id);
    
    List<ZTreeNodes> selectAllResourceZTreeNode();
    
    List<SysmanResource> selectResourceListByUserId(Long userId);
    
    /**
     * 获取到所有 parent_id 为 null 的 资源集合
     * @return
     */
    List<SysmanResource> selectSysmanResourceListByNullParentId();
    
    /**
     * 根据当前用户 ID 与 当前资源的主键 id，获取到 用户包含的 权限集合
     * @param userId
     * @param parentId
     * @return
     */
    List<SysmanResource> selectIconResourceByUserIdAndParentId(@Param("userId") Long userId, @Param("parentId") String parentId);
}